import React from "react";
class Form extends React.Component {
  txtRef = React.createRef()
  render() {
    return (
      <>
        <input type="text" ref={this.txtRef} />
        <button onClick={() => console.log(this.txtRef.current.value)}>提交</button>
      </>
    )
  }
}
export default Form